import type { OrderPay, OrderPayExportQuery, OrderPayQuery } from './model';

import type { PageResult } from '#/api/common';

import { requestClient } from '#/api/request';

enum Api {
  orderPayExport = '/orderPay/v1/orderPayExport',
  orderPayList = '/orderPay/v1/pageList',
}

/**
 * 支付对账分页列表
 * @param data 请求参数
 * @returns 列表
 */
export function orderPayList(
  data?: OrderPayQuery & { pageNo?: number; pageSize?: number },
) {
  return requestClient.post<PageResult<OrderPay>>(Api.orderPayList, data);
}

/**
 * 导出支付对账
 * @param data 请求参数
 */
export function orderPayExport(
  data?: OrderPayExportQuery & { pageNo?: number; pageSize?: number },
) {
  return requestClient.post<Blob>(Api.orderPayExport, data, {
    data,
    isTransformResponse: false,
    responseType: 'blob',
  });
}
